home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1993 / Internet Info CD-ROM (Walnut Creek) (1993).iso / networking / mail / sendmail / uucpdomain.shar / uucpdomain / diffs.sendmail next >
Encoding:
Text File  |  1988-01-25  |  6.4 KB  |  269 lines

  1. *** sendmail/src/sendmail.h.orig    Wed Jul 23 18:27:00 1986
  2. --- sendmail/src/sendmail.h    Thu Feb 26 18:46:07 1987
  3. ***************
  4. *** 321,326 ****
  5. --- 325,336 ----
  6.   # define HOSTBEGIN    '\035'    /* hostname lookup begin */
  7.   # define HOSTEND    '\036'    /* hostname lookup end */
  8.   
  9. + #if defined(DBM) && defined(UUCPDOMAIN)
  10. + /* brace characters for uucp name lookup */
  11. + # define UUCPBEGIN    '\016'    /* uucpname lookup begin */
  12. + # define UUCPEND    '\017'    /* uucpname lookup end */
  13. + #endif
  14.   /* \001 is also reserved as the macro expansion character */
  15.    /*
  16.   **  Information about hosts that we have looked up recently.
  17. ***************
  18. *** 531,536 ****
  19. --- 543,549 ----
  20.   EXTERN char    *mxhosts[MAXMXHOSTS+1];    /* for MX RRs */
  21.   EXTERN char    *TrustedUsers[MAXTRUST+1];    /* list of trusted users */
  22.   EXTERN char    *UserEnviron[MAXUSERENVIRON+1];    /* saved user environment */
  23. + EXTERN char    *PaliasFile;    /* location of pathalias file */
  24.    /*
  25.   **  Trace information
  26.   */
  27. *** sendmail/src/daemon.c.orig    Wed Jul 23 18:27:01 1986
  28. --- sendmail/src/daemon.c    Wed Mar 18 13:18:36 1987
  29. ***************
  30. *** 604,606 ****
  31. --- 607,712 ----
  32.   }
  33.   
  34.   #endif DAEMON
  35. + #if defined(DBM) && defined(UUCPDOMAIN)
  36. + /* XXX */
  37. + #ifdef sun
  38. + #undef NULL
  39. + #endif
  40. + #include <dbm.h>
  41. + /* XXX */
  42. + #ifdef sun
  43. + #undef NULL
  44. + #define    NULL    0
  45. + #endif
  46. +  /*
  47. + **  PATHALIAS -- return the shortest path to this host.
  48. + **
  49. + **    Parameters:
  50. + **        hbuf -- a buffer containing a hostname.
  51. + **
  52. + **    Returns:
  53. + **        The shortest known path to this host.
  54. + **
  55. + **    Side Effects:
  56. + **        none.
  57. + */
  58. + datum
  59. + pathalias(hbuf)
  60. + register char *hbuf;
  61. + {
  62. +     register char *bptr;
  63. +     register datum hdatum;
  64. +     hdatum.dptr = hbuf;
  65. +     hdatum.dsize = strlen(hbuf) + 1;
  66. +     hdatum = fetch(hdatum);
  67. +     if (hdatum.dptr != NULL)
  68. +         if ((bptr = rindex(hdatum.dptr, '%')) == NULL ||
  69. +             *(bptr + 1) != 's')
  70. +             hdatum.dptr = NULL;
  71. +         else if (*(bptr + 2) == '@')
  72. +             /* path!%s@host -> path!host!%s */
  73. +             (void) sprintf(bptr, "%s!%%s", bptr + 3);
  74. +     return hdatum;
  75. + }
  76. +  /*
  77. + **  MAPUUCPHOSTNAME -- turn a hostname into the shortest uucp path
  78. + **
  79. + **    Parameters:
  80. + **        hbuf -- a buffer containing a hostname.
  81. + **        hbsize -- the size of hbuf.
  82. + **
  83. + **    Returns:
  84. + **        none.
  85. + **
  86. + **    Side Effects:
  87. + **        Looks up the host specified in hbuf.  Replace it
  88. + **        with the shortest uucp path to that host.
  89. + */
  90. + mapuucpname(hbuf, hbsize)
  91. +     register char *hbuf;
  92. +     register int hbsize;
  93. + {
  94. +     register char *bptr;
  95. +     register datum hdatum;
  96. +     register bool mapped = FALSE;
  97. +     makelower(hbuf);
  98. +     hdatum = pathalias(hbuf);
  99. +     if (hdatum.dptr != NULL && hdatum.dsize <= hbsize) {
  100. +         (void) strcpy(hbuf, hdatum.dptr);
  101. +         return;
  102. +     }
  103. +     if ((bptr = rindex(hbuf, '.')) == NULL)
  104. +         return;
  105. +     if (strncmp(bptr, ".uucp", sizeof ".uucp") == 0) {
  106. +         /* try host with .uucp removed */
  107. +         *bptr = '\0';
  108. +         hdatum = pathalias(hbuf);
  109. +         *bptr = '.';
  110. +         if (hdatum.dptr != NULL && hdatum.dsize <= hbsize)
  111. +             (void) strcpy(hbuf, hdatum.dptr);
  112. +     }
  113. +     else
  114. +     {
  115. +         /* keep removing left-most subdomain until a match is found */
  116. +         for (bptr = hbuf;
  117. +              !mapped && (bptr = index(++bptr, '.')) != NULL;
  118. +              mapped = hdatum.dptr != NULL &&
  119. +                   hdatum.dsize + strlen(hbuf) + 1 <= hbsize)
  120. +             hdatum = pathalias(bptr);
  121. +         if (!mapped || (bptr = rindex(hdatum.dptr, '!')) == NULL)
  122. +             return;
  123. +         *bptr = '\0';
  124. +         if ((bptr = malloc(strlen(hbuf) + 1)) != NULL) {
  125. +             (void) strcpy(bptr, hbuf);
  126. +             (void) sprintf(hbuf, "%s!%s!%%s", hdatum.dptr, bptr);
  127. +             (void) free(bptr);
  128. +         }
  129. +     }
  130. + }
  131. + #endif
  132. *** sendmail/src/main.c.orig    Thu Jan 30 14:03:53 1986
  133. --- sendmail/src/main.c    Mon Jan 26 14:33:20 1987
  134. ***************
  135. *** 808,813 ****
  136. --- 812,822 ----
  137.       /* and finally the hostname lookup characters */
  138.       '[', HOSTBEGIN,    ']', HOSTEND,
  139.   
  140. + #if defined(DBM) && defined(UUCPDOMAIN)
  141. +     /* and the uucpname lookup characters */
  142. +     '{', UUCPBEGIN,    '}', UUCPEND,
  143. + #endif
  144.       '\0'
  145.   };
  146.   
  147. *** sendmail/src/parseaddr.c.orig    Wed Apr  2 19:04:03 1986
  148. --- sendmail/src/parseaddr.c    Wed Mar 18 12:10:50 1987
  149. ***************
  150. *** 741,747 ****
  151. --- 741,751 ----
  152.               char pvpbuf[PSBUFSIZE];
  153.               extern char *DelimChar;
  154.   
  155. + #if defined(DBM) && defined(UUCPDOMAIN)
  156. +             if (**rvp != HOSTBEGIN && **rvp != UUCPBEGIN)
  157. + #else
  158.               if (**rvp != HOSTBEGIN)
  159. + #endif
  160.                   continue;
  161.   
  162.               /*
  163. ***************
  164. *** 753,759 ****
  165. --- 757,769 ----
  166.               hbrvp = rvp;
  167.   
  168.               /* extract the match part */
  169. + #if defined(DBM) && defined(UUCPDOMAIN)
  170. +             while (*++rvp != NULL &&
  171. +                    (**rvp != HOSTEND && **hbrvp == HOSTBEGIN ||
  172. +                 **rvp != UUCPEND && **hbrvp == UUCPBEGIN))
  173. + #else
  174.               while (*++rvp != NULL && **rvp != HOSTEND)
  175. + #endif
  176.                   continue;
  177.               if (*rvp != NULL)
  178.                   *rvp++ = NULL;
  179. ***************
  180. *** 764,770 ****
  181. --- 774,801 ----
  182.   
  183.               /* look it up */
  184.               cataddr(++hbrvp, buf, sizeof buf);
  185. + #if defined(DBM) && defined(UUCPDOMAIN)
  186. +             if (**(hbrvp - 1) == HOSTBEGIN)
  187. +                 maphostname(buf, sizeof buf);
  188. +             else
  189. +             {
  190. + #ifdef sun
  191. +                 (void) dbmclose();
  192. + #endif
  193. +                 if (dbminit(PaliasFile) == 0)
  194. + #ifdef sun
  195. +                 {
  196. + #endif
  197. +                     mapuucpname(buf, sizeof buf);
  198. + #ifdef sun
  199. +                     (void) dbmclose();
  200. +                 }
  201. + #endif
  202. +                 (void) dbminit(AliasFile);
  203. +             }
  204. + #else
  205.               maphostname(buf, sizeof buf);
  206. + #endif
  207.   
  208.               /* scan the new host name */
  209.               olddelimchar = DelimChar;
  210. *** sendmail/src/alias.c.orig    Thu Apr 17 23:18:56 1986
  211. --- sendmail/src/alias.c    Mon Jan 26 14:26:42 1987
  212. ***************
  213. *** 92,97 ****
  214. --- 92,100 ----
  215.           p = aliaslookup(a->q_user);
  216.       if (p == NULL)
  217.           return;
  218. + #if defined(DBM) && defined(UUCPDOMAIN)
  219. +     p = newstr(p);
  220. + #endif
  221.   
  222.       /*
  223.       **  Match on Alias.
  224. *** sendmail/src/Makefile.orig    Wed Jul 23 18:29:21 1986
  225. --- sendmail/src/Makefile    Sat Feb 14 13:23:50 1987
  226. ***************
  227. *** 36,42 ****
  228.   CHMOD=    chmod
  229.   O=    -O
  230.   COPTS=
  231. ! CCONFIG=-I../include -DVMUNIX -DMXDOMAIN -DOLDJEEVES
  232.   CFLAGS=    $O $(COPTS) $(CCONFIG)
  233.   ASMSED=    ../include/asm.sed
  234.   AR=    -ar
  235. --- 36,42 ----
  236.   CHMOD=    chmod
  237.   O=    -O
  238.   COPTS=
  239. ! CCONFIG=-I../include -DVMUNIX -DMXDOMAIN -DOLDJEEVES -DUUCPDOMAIN
  240.   CFLAGS=    $O $(COPTS) $(CCONFIG)
  241.   ASMSED=    ../include/asm.sed
  242.   AR=    -ar
  243. *** sendmail/src/readcf.c.orig    Sat Jan 11 03:18:47 1986
  244. --- sendmail/src/readcf.c    Thu Feb 26 18:41:55 1987
  245. ***************
  246. *** 913,918 ****
  247. --- 913,925 ----
  248.           WkTimeFact = atoi(val);
  249.           break;
  250.   
  251. +       case 'p':        /* pathalias file */
  252. +         if (val[0] == '\0')
  253. +             PaliasFile = "palias";
  254. +         else
  255. +             PaliasFile = newstr(val);
  256. +         break;
  257.         default:
  258.           break;
  259.       }
  260.